package org.nvframe.event.eventtype;

import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.state.StateBasedGame;
import org.nvframe.event.AbstractEvent;
import org.nvframe.event.EventListener;

/**
 * 
 * @author Nik Van Looy
 */
public class RenderEvent extends AbstractEvent {

	private static Class<? extends EventListener> listener = RenderListener.class;
	
	private GameContainer gc;
	private StateBasedGame sb;
	private Graphics gr;

	public RenderEvent(GameContainer gc, StateBasedGame sb, Graphics gr) {
		// set event-specific properties
		this.gc = gc;
		this.sb = sb;
		this.gr = gr;
	}
	
	public void dispatchToListener(EventListener listener) {
		((RenderListener) listener).onRender(this);
	}

	public GameContainer getGc() {
		return gc;
	}

	public StateBasedGame getSb() {
		return sb;
	}

	public Graphics getGr() {
		return gr;
	}

	@Override
	protected Class<? extends EventListener> getListener() {
		return listener;
	}
}
